package com.gyd.utils;

import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;



public class Utils {

	static final Logger log= Logger.getLogger(Utils.class);
	
	
	
	public static Integer Obj2Integer(Object obj){
		return Integer.parseInt(String.valueOf(obj));
	}


	public static boolean isString(String str){
		
		if(str==null){
			return false;
		}
		if(str.length()>1)
			return true;
		return false;
	}
	public static Integer string2Integer(String str){
		String methodName="string2Integer() :";
		BasicConfigurator.configure();
		try{
			int nuevoValor=Integer.parseInt(str);
			return nuevoValor;
		}
		catch(Exception e){
			log.debug(methodName+""+e);
			return 0;
		}
	}
	
	public static Double Obj2Double(Object obj){
		return Double.parseDouble(String.valueOf(obj));
	}
}
